package xin.marcher.module.seller.converter;

import org.mapstruct.Mapper;
import xin.marcher.module.seller.domain.dto.SellerInfoDTO;
import xin.marcher.module.seller.domain.entity.SellerInfoDO;
import xin.marcher.module.seller.domain.request.SellerInfoRequest;
import xin.marcher.module.seller.domain.response.SellerInfoResponse;

import java.util.List;

/**
 * 卖家信息对象克隆
 */
@Mapper(componentModel = "spring", uses = ListMapper.class)
public interface SellerInfoConverter {
    /**
     * 卖家DO -> request
     *
     * @param request
     * @return
     */
    SellerInfoDO requestToEntity(SellerInfoRequest request);

    /**
     * 卖家list DO -> response
     *
     * @param records
     * @return
     */
    List<SellerInfoResponse> listEntityToResponse(List<SellerInfoDO> records);

    /**
     * 卖家response -> DTO
     *
     * @param sellerInfoResponse
     * @return
     */
    SellerInfoDTO responseToDTO(SellerInfoResponse sellerInfoResponse);

    /**
     * 卖家DO -> response
     *
     * @param selectOne
     * @return
     */
    SellerInfoResponse entityToResponse(SellerInfoDO selectOne);
}
